import { Redirect, Route } from 'react-router-dom';
import isLoggedIn from './AuthService';

const PrivateRoute = ({ ...props }) =>
    isLoggedIn()
        ? <Route {...props} />
        : <Redirect to="/login" />

export default PrivateRoute;